#include<iostream>
#include<vector>
#include<string>
#include<list>

using namespace std;

void slove()
{
	string str;
	cin >> str;

	if (str == "abc")
	{
		cout << "YES" << endl;
	}
	else if (str == "acb")
	{
		cout << "YES" << endl;
	}
	else if (str == "bac")
	{
		cout << "YES" << endl;
	}
	else if (str == "cba")
	{
		cout << "YES" << endl;
	}
	else
	{
		cout << "NO" << endl;
	}
}
int main()
{
	int t;
	cin >> t;

	while (t--)
	{
		slove();
	}
	return 0;
}